

---  data_cache 白名单ip_allow配置说明：
---	   跟 ssdb_server ssdb_db_select配置在同一层
---
---    ip_allow = { check = 1,	list = '120.24.64.132 192.168.1.1',},
---
---    check值：   0=不检查   1=仅打印报错日志   2=禁止访问并打印报错日志
---        报错日志在  logs/miniw/dc_allow_ip_20210101.log 中，前期可以用check=1来检查ip列表
---
---	   list值：    [[字符串]] 用空格分隔的ip列表

local require = require
local ns_acc_config1 = require( "modules.data_cache.config.db_acc_config1")


local const_ = {
	auth = 'xZtXkxJFyhHbfSbOXs6NflySwUHGCnLI';
	ip1 = '127.0.0.1',
};


local ns_config = {
	_VERSION        = '0.12.1',
	__DAY_TIME__    = 86400,

	ssdb = {

		posting = {
			ssdb_server    = { [0] = {	 ip = '127.0.0.1',    port = 17260,  auth=const_.auth, },	},
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, },
			ip_allow = { check = 1,	list = '120.24.64.132 192.168.1.1',},
		},

		subsp = {
			ssdb_server    = { [0] = {	 ip = '127.0.0.1',    port = 18100,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		rcm = {		-- 未再使用
			ssdb_server = {	[0] = {	 ip = '127.0.0.1',    port = 17280,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		map = {
			ssdb_server = {	[0] = {	 ip = '127.0.0.1',    port = 17200,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},


		map_kvx = {
			ssdb_server = {	[0] = {	 ip = '127.0.0.1',    port = 17250,  auth=const_.auth, },	},
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},


		cm = {
			ssdb_server = {	[0] = {	 ip = '127.0.0.1',    port = 18200,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		rent = {
			ssdb_server = {	[0] = {	 ip = '127.0.0.1',    port = 17270,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		ma = {
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 17101,  auth=const_.auth, },
				[11] = { ip = '127.0.0.1',    port = 17111,  auth=const_.auth, },
			},
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm=11, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		battlepass ={
			ssdb_server = { [0]  = { ip = '127.0.0.1',    port = 18900,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0 },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		gchat = {
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 17101,  auth=const_.auth, },
				[11] = { ip = '127.0.0.1',    port = 17111,  auth=const_.auth, },
			},
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm=11, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

        achieve = {
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 17101,  auth=const_.auth, },
				[11] = { ip = '127.0.0.1',    port = 17111,  auth=const_.auth, },
			},
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm=11, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		punisher = {
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 18300,  auth=const_.auth, },
				[11] = { ip = '127.0.0.1',    port = 18311,  auth=const_.auth, },
			},
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm=11, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		manor = 
		{
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 18700,  auth=const_.auth, },
				[11]  = { ip = '127.0.0.1',    port = 18700,  auth=const_.auth, },
			},
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm = 11, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		anti_addiction = 
		{
			ssdb_server = {	[0]  = { ip = '127.0.0.1',    port = 16100,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm = 0, },
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		team = 
		{
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 19700,  auth=const_.auth, },
				[11]  = { ip = '127.0.0.1',    port = 19700,  auth=const_.auth, },
			},
			ssdb_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm = 11,
			},
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		accUinInfo = {
			ssdb_server = {	[0]  = { ip = '127.0.0.1',    port = 18500,  auth=const_.auth, },	},
			ssdb_db_select = {[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,	},
			ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		business = {
			ssdb_server = { [0]  = { ip = '127.0.0.1',    port = 18600,  auth=const_.auth, }, },
			ssdb_db_select = { [0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, comm = 0, },
			--ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		friend = {
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 17600,  auth=const_.auth, },
			},
			ssdb_db_select = {
				[0]=0,  [1]=0,  [2]=0,  [3]=0,   [4]=0,  [5]=0,  [6]=0,  [7]=0,  [8]=0,  [9]=0,
				[10]=0, [11]=0, [12]=0, [13]=0, [14]=0, [15]=0, [16]=0, [17]=0, [18]=0, [19]=0,
				[20]=0, [21]=0, [22]=0, [23]=0, [24]=0, [25]=0, [26]=0, [27]=0, [28]=0, [29]=0,
				[30]=0, [31]=0, [32]=0, [33]=0, [34]=0, [35]=0, [36]=0, [37]=0, [38]=0, [39]=0,
				[40]=0, [41]=0, [42]=0, [43]=0, [44]=0, [45]=0, [46]=0, [47]=0, [48]=0, [49]=0,
				[50]=0, [51]=0, [52]=0, [53]=0, [54]=0, [55]=0, [56]=0, [57]=0, [58]=0, [59]=0,
				[60]=0, [61]=0, [62]=0, [63]=0, [64]=0, [65]=0, [66]=0, [67]=0, [68]=0, [69]=0,
				[70]=0, [71]=0, [72]=0, [73]=0, [74]=0, [75]=0, [76]=0, [77]=0, [78]=0, [79]=0,
				[80]=0, [81]=0, [82]=0, [83]=0, [84]=0, [85]=0, [86]=0, [87]=0, [88]=0, [89]=0,
				[90]=0, [91]=0, [92]=0, [93]=0, [94]=0, [95]=0, [96]=0, [97]=0, [98]=0, [99]=0,
				select_mod = 100,
			},
			--ip_allow = { check = 1,	list = '120.24.64.132',},
		},

		welfare =
		{
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 18800,  auth=const_.auth, },
			},
			ssdb_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,comm = 0,
			},	
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

		business_advert =
		{
			ssdb_server = {
				[0]  = { ip = '127.0.0.1',    port = 18801,  auth=const_.auth, },
			},
			ssdb_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0, ["comm"] = 0,
			},	
			ip_allow = { check = 1,	list = '127.0.0.1 120.24.64.132 183.240.204.116'},
		}

	},


	---for  cloud mysql
	mysql = {

		mapbag = {
			mysql_server = {
				[0] = {
					host='10.80.240.84', port=3306, user='mmog', password='mmog',
					database='db_rank', table_name = 't_miniw_kv',
				},
			},
			mysql_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
	    },

		hot_update = {
			mysql_server = {
				[0] = {
					host='10.80.240.84', port=3306, user='mmog', password='mmog',
					database='hot_update', table_name = 't_miniw_kv',
				},
			},
			mysql_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

		avatar_khv = {
			mysql_server = {
				[0] = {
					host='10.80.240.84', port=3306, user='mmog', password='mmog',
					database='db_avatar', table_name = 't_miniw_kv',
				},
			},
			mysql_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

		team_mysql = {
			mysql_server = {
				[0] = {
					host='10.80.240.84', port=3306, user='mmog', password='mmog',
					database='db_team', table_name = 't_miniw_kv',
				},
			},
			mysql_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},


		----测试使用
		demo_test = {
			mysql_server = {
				[0] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo0', table_name='t_demo_kv0', },
				[1] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo0', table_name='t_demo_kv1', },
				[2] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo0', table_name='t_demo_kv2', },
				[3] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo0', table_name='t_demo_kv3', },
				[4] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo0', table_name='t_demo_kv4', },

				[5] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo1', table_name='t_demo_kv5', },
				[6] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo1', table_name='t_demo_kv6', },
				[7] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo1', table_name='t_demo_kv7', },
				[8] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo1', table_name='t_demo_kv8', },
				[9] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_demo1', table_name='t_demo_kv9', },
			},
			mysql_db_select = {
				[0]=0, [1]=1, [2]=2, [3]=3, [4]=4, [5]=5, [6]=6, [7]=7, [8]=8, [9]=9,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},


		-- 订阅（双写测试）
		subsp = {
			mysql_server = {
				[0] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp0', table_name='t_subsp_kv0', },
				[1] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp0', table_name='t_subsp_kv1', },
				[2] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp0', table_name='t_subsp_kv2', },
				[3] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp0', table_name='t_subsp_kv3', },
				[4] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp0', table_name='t_subsp_kv4', },

				[5] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp1', table_name='t_subsp_kv5', },
				[6] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp1', table_name='t_subsp_kv6', },
				[7] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp1', table_name='t_subsp_kv7', },
				[8] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp1', table_name='t_subsp_kv8', },
				[9] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_subsp1', table_name='t_subsp_kv9', },
			},
			mysql_db_select = {
				[0]=0, [1]=1, [2]=2, [3]=3, [4]=4, [5]=5, [6]=6, [7]=7, [8]=8, [9]=9,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

		-- 地图服数据
		map = {
			mysql_server = {
				[0] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map0', table_name='t_map_kv0', },
				[1] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map0', table_name='t_map_kv1', },
				[2] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map0', table_name='t_map_kv2', },
				[3] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map0', table_name='t_map_kv3', },
				[4] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map0', table_name='t_map_kv4', },

				[5] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map1', table_name='t_map_kv5', },
				[6] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map1', table_name='t_map_kv6', },
				[7] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map1', table_name='t_map_kv7', },
				[8] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map1', table_name='t_map_kv8', },
				[9] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog', database='db_map1', table_name='t_map_kv9', },
			},
			mysql_db_select = {
				[0]=0, [1]=1, [2]=2, [3]=3, [4]=4, [5]=5, [6]=6, [7]=7, [8]=8, [9]=9,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

		---配置比较大，使用独立文件
		acc_new      = ns_acc_config1.mysql.acc_new,
		acc_business = ns_acc_config1.mysql.acc_business,
		acc_order    = ns_acc_config1.mysql.acc_order,

		--- 社交
		social = {
			mysql_server = {
				[0] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog',
						   database='db_social0', table_name='t_social_kv0', },
			},
			mysql_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

    },


	--- huawei-cloud GaussDB for redis
	redis = {
		posting_redis = {
			redis_server = {
				[0] = {	 ip='139.9.195.116', port =8635, auth='MjZkYjUwYzU3OTRj!#%' },
			},
			redis_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},
	},


	---数据只存share_dict, 数据不落地写
	shm = {
		team_shm = {
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

		--- 社交
		social_shm = {
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},

		--- 账号服在线
		acc_cache = {
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		},
	},


	--- mysql模式的绑定关系查询表
	mysql_binding = {
		--- 账号服 name 到 uin 的绑定对应表 mysql模式
		acc_name_uin = {
			mysql_server = {
				[0] = {	host='10.80.240.84', port=3306, user='mmog', password='mmog',
						   database='db_acc', table_name='t_bind_acc_name_uin', },
			},
			mysql_db_select = {
				[0]=0, [1]=0, [2]=0, [3]=0, [4]=0, [5]=0, [6]=0, [7]=0, [8]=0, [9]=0,
			},
			ip_allow = { check = 1,	list = '120.24.64.132 183.240.204.116',},
		}
	},


};


return ns_config;

